Let $f(x)$ and $g(x)$ be nonzero polynomials such that
\[f(g(x)) = f(x) g(x).\]If $g(2) = 37,$ find $g(x).$
Let $m$ and $n$ be the degrees of $f(x)$ and $g(x),$ respectively.  Then the degree of $f(g(x))$ is $mn.$  The degree of $f(x) g(x)$ is $m + n,$ so
\[mn = m + n.\]Applying Simon's Favorite Factoring Trick, we get $(m - 1)(n - 1) = 1,$ so $m = n = 2.$

Let $f(x) = ax^2 + bx + c$ and $g(x) = dx^2 + ex + f.$  Then
\[a(dx^2 + ex + f)^2 + b(dx^2 + ex + f) + c = (ax^2 + bx + c)(dx^2 + ex + f).\]Expanding, we get
\begin{align*}
&ad^2 x^4 + 2adex^3 + (2adf + ae^2 + bd) x^2 + (2aef + be)x + af^2 + bf + c \\
&\quad = adx^4 + (ae + bd) x^3 + (af + be + cd) x^2 + (bf + ce) x + cf.
\end{align*}Matching coefficients, we get
\begin{align*}
ad^2 &= ad, \\
2ade &= ae + bd, \\
2adf + ae^2 + bd &= af + be + cd, \\
2aef + be &= bf + ce, \\
af^2 + bf + c &= cf.
\end{align*}Since $a$ and $d$ are nonzero, the equation $ad^2 = ad$ tells us $d = 1.$  Thus, the system becomes
\begin{align*}
2ae &= ae + b, \\
2af + ae^2 + b &= af + be + c, \\
2aef + be &= bf + ce, \\
af^2 + bf + c &= cf.
\end{align*}Then $b = ae.$  Substituting, the system becomes
\begin{align*}
2af + ae^2 + ae &= af + ae^2 + c, \\
2aef + ae^2 &= aef + ce, \\
af^2 + aef + c &= cf.
\end{align*}Then $af + ae = c,$ so $af^2 + aef = cf$.  Hence, $c = 0,$ which means $ae + af = 0.$ Since $a$ is nonzero, $e + f = 0.$

Now, from $g(2) = 37,$ $4 + 2e + f = 37.$  Hence, $e = 33$ and $f = -33.$  Therefore, $g(x) = \boxed{x^2 + 33x - 33}.$